package com.zsrt.java.day20161226.zzm.demo03;

import java.util.Scanner;

import org.junit.Test;

public class TwoTest {
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		while(true){
			System.out.println("请输入第一个数:");
			int a = sc.nextInt();
			System.out.println("请输入第二个数:");
			int b = sc.nextInt();
			System.out.println("第一个数为:a="+a);
			System.out.println("第二个数为:b="+b);
			swaft(a, b);
			System.out.println("退出请输入小写字符y,继续请按c");
			String temp = sc.next();
			if(temp.equals("y")){
				System.out.println("程序已退出......");
				break;
			}
		}
		    sc.close();
	}
	
	public static void swaft(int a,int b){
		if(a>b){
			int c = a;
			    a = b;
			    b = c;
			System.out.println("交换位置后......");
			System.out.println("第一个数为:a="+a);
			System.out.println("第二个数为:b="+b);
		}
		
	}
}
